package com.moli.iov.handle.alarm.model.dto;

import com.moli.iov.handle.alarm.enums.AlarmCodeEnum;
import java.util.Date;
import lombok.Data;

import java.io.Serializable;

/**
 * <p>
 * 报警DTO
 * </p>
 *
 * @author: zql
 * @Date: 2019/2/19 10:02
 */
@Data
public class AlarmDto implements Serializable {
    private static final long serialVersionUID = -83057365222422772L;

    public AlarmDto() {
    }

    public AlarmDto(String vin,
                    Integer alarmCode,
                    Integer alarmLevel,
                    Integer alarmType,
                    Integer alarmSource,
                    String memo,
                    Boolean  isAntiShake) {

        this.vin = vin;
        this.alarmCode = alarmCode;
        this.alarmLevel = alarmLevel;
        this.alarmType = alarmType;
        this.alarmSource = alarmSource;
        this.memo = memo;
        this.isAntiShake = isAntiShake;
    }

    public AlarmDto(String vin,
                    AlarmCodeEnum alarmCodeEnum,
                    Integer alarmType,
                    Integer alarmSource,
                    String memo,
                    Boolean  isAntiShake,
                    Double longitude,
                    Double latitude) {

        this.vin = vin;
        this.alarmCode = alarmCodeEnum.getFlag();
        this.alarmLevel = alarmCodeEnum.getLevel();
        this.alarmType = alarmType;
        this.alarmSource = alarmSource;
        this.memo = memo;
        this.isAntiShake = isAntiShake;
        this.longitude = longitude;
        this.latitude = latitude;
    }

    public AlarmDto(String vin,
                    AlarmCodeEnum alarmCodeEnum,
                    Integer alarmType,
                    Integer alarmSource,
                    String memo,
                    Boolean  isAntiShake,
                    Double longitude,
                    Double latitude,
                    Double currentMileage,
                    Double thresholdMileage) {

        this.vin = vin;
        this.alarmCode = alarmCodeEnum.getFlag();
        this.alarmLevel = alarmCodeEnum.getLevel();
        this.alarmType = alarmType;
        this.alarmSource = alarmSource;
        this.memo = memo;
        this.isAntiShake = isAntiShake;
        this.longitude = longitude;
        this.latitude = latitude;
        this.currentMileage = currentMileage;
        this.thresholdMileage = thresholdMileage;
    }

    /**
     * 企业id
     */
    private Long companyId;

    /**
     * 企业名称
     */
    private String companyName;

    /**
     * 车架号
     */
    private String vin;

    /**
     * 车牌号
     */
    private String license;

    /**
     * 报警编码
     */
    private Integer alarmCode;

    /**
     * 故障级别 1、一级报警  2、二级报警  3、三级报警
     */
    private Integer alarmLevel;

    /**
     * 类型： 1、报警  2、故障
     */
    private Integer alarmType;

    /**
     * 报警来源： 1、T-Box上报 2、平台判断
     */
    private Integer alarmSource;

    /**
     * 备注
     */
    private String memo;

    /**
     * 是否防抖  true 防抖  false 不防抖
     */
    private Boolean  isAntiShake;

    /**
     * 是否校验 正在报警
     */
    private Boolean isCheckAlarming = true;

    /**
     * 经度
     */
    private Double longitude;

    /**
     * 纬度
     */
    private Double latitude;

    /**
     * 当前里程
     */
    private Double currentMileage;

    /**
     * 有效里程/阀值里程
     */
    private Double thresholdMileage;

    /**
     * 终端采集时间
     */
    private Date collectDate;

    /**
     * 最后上报时间
     */
    private Date lastReportDate;

    /**
     * 上次里程
     */
    private Double lastTimeMileage;


    /**
     * 异变里程数
     */
    private Double differenceMileage;

    /**
     * 异变阈值
     */
    private Double milExThreshold;

    /**
     * 实际行驶里程
     */
    private Double actualMileage;

    /**
     * GPS累计里程
     */
    private Double gpsMileage;

    /**
     * 围栏id
     */
    private Long fenceId;

    /**
     * 围栏名称
     */
    private String fenceName;

}
